<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的礼物</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" href="/static/index/css/page/base.css"/>
    <link rel="stylesheet" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" href="/static/index/jquery_weui/css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/lib/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/personal.css" />
</head>
<style>

</style>
<body>
<div class="pageControl wallet bg-f5">
    <!--主体-->
    <div class="main">
        <div class="bg-di"></div>
        <div class="msui_nav msui_navTop">
            <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
            <h1 class="msui_navTop-title">礼物记录</h1>
            <span class="msui_navTop-icon clear" href="javascript:;">
                清除记录
            </span>
        </div>
    </div>
    <div class="weui-form-preview">
        <div class="append"></div>
        <input type="hidden" class="page" value="1"/>
    </div>
    {if $count neq 0}
    <div class="load_more">点击加载更多</div>
    {else}
    <div class="no_list">暂时无收送礼记录</div>
    {/if}
</div>
<!-- jquery-2.1.4 -->
<script type="text/javascript" src="/static/index/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script>
    $(function () {
        $.post(
            "/index/personal/gift_notes_list",
            function(msg){
                if(msg.code == 200){
                    $('.append').append(msg.tpl);
                }
            },'json'
        )
    })
    $('.load_more').on('click',function () {
        var pages;
        var count = 0;
        page = $('.page').val();
        if(page == 1){
            page = $('.page').val();
        }else{
            page == pages
        }
        $.post(
            "/index/personal/gift_notes_list",
            {page:page},
            function(msg){
                if(msg.code == 200){
                    $('.append').append(msg.tpl);
                    $('.page').val(++page);
                    pages = ++page;
                    if(msg.count == 0){
                        $('.load_more').html('暂无更多记录');
                    }
                }
            },'json'
        )
    })
    /*清除记录*/
    $('.clear').on('click',function () {
        $.post(
            '/index/personal/delete_notes',
            function (data) {
                if(data.code == 200){
                    alert(data.msg);
                    history.go(-1);
                }else{
                    alert(data.msg);
                }
            },'json'
        )
    })
</script>
<script type="text/javascript" src="/static/index/jquery_weui/js/jquery-weui.min.js"></script>
<script src="/static/index/jquery_weui/js/swiper.min.js"></script>
</body>
</html>

